home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / ImageFX_Export_Render.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1996-11-15  |  1.5 KB  |  76 lines

  1. /*
  2. ** $VER: ImageFX_Export_Render 1.0
  3. **
  4. ** Copyright © 1996 by Simon Edwards
  5. **
  6. ** This ARexx script exports the rendered image of the PRIMARY image
  7. ** in ImageEngineer to ImageFX. Both programs must be running at the
  8. ** same time.
  9. ** This script has been tested with ImageFX 1.5 and
  10. ** requires ImageEngineer 3.0 (or higher).
  11. **
  12. */
  13.  
  14. OPTIONS RESULTS
  15. SIGNAL ON ERROR
  16. TEMP_FILE = 't:Image_from_IE'
  17.  
  18. if arg()==0 then exit
  19.  
  20. /* Main code */
  21.  
  22. IF ~SHOW(PORTS,'IMAGEFX.1') THEN DO
  23.      'REQUEST' '"Could not locate ImageFxs ARexx port!"' '" OK "'
  24.     CALL ErrorOut 10
  25. END
  26.  
  27. 'RENDER' arg(1)
  28.  
  29. 'SAVE' arg(1) '"'||TEMP_FILE||'"' '"ILBM CmpByteRun1"'
  30. IF (RC ~= 0) THEN DO
  31.      'REQUEST' '"Error when saving temporary image!"' '" OK "'
  32.     CALL ErrorOut 10
  33. END
  34.  
  35. 'RENDER_CLOSE' arg(1)
  36.  
  37. ADDRESS "IMAGEFX.1"
  38.  
  39. Screen2Front
  40.  
  41. LoadBuffer '"'TEMP_FILE'"' force
  42. IF (RC ~= 0) THEN DO
  43.   ADDRESS 'IMAGEENGINEER'
  44.      'REQUEST' '"Error when loading temporary image into ImageFX!"' '" OK "'
  45.     CALL ErrorOut 10
  46. END
  47.  
  48. CALL Errorout 0
  49.  
  50. /* Errorout procedure */
  51.  
  52. ErrorOut:
  53.     PARSE ARG ExitCode
  54.  
  55.     IF (EXISTS( TEMP_FILE )) THEN DO
  56.       ADDRESS COMMAND "Delete >NIL:" TEMP_FILE
  57.   END
  58.   
  59.     EXIT ExitCode
  60.  
  61. /* IE's error procedure */
  62.  
  63. Error:
  64. if RC=5 then do            /* Did the user just cancel us? */
  65.     IE_TO_FRONT
  66.     LAST_ERROR
  67.     'REQUEST "'||RESULT||'"'
  68.     exit
  69. end
  70. else do
  71.     IE_TO_FRONT
  72.     LAST_ERROR
  73.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  74.     exit
  75. end
  76.